package cn.iocoder.yudao.module.product.controller.app.spu.vo;

import cn.iocoder.yudao.module.product.dal.dataobject.category.ProductCategoryDO;
import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
public class AppProductSkuRespOptionVO {
    @Schema(description = "ID")
    private Long id;
    @Schema(description = "名称")
    private String name;
    @Schema(description = "描述")
    private String description;
    @Schema(description = "是否为默认值")
    private boolean isDefault;

    public static AppProductSkuRespOptionVO fromProductCategory(ProductCategoryDO category) {
        AppProductSkuRespOptionVO vo = new AppProductSkuRespOptionVO();
        vo.id = category.getId();
        vo.name = category.getName();
        vo.description = category.getDescription();
        return vo;
    }

    public static AppProductSkuRespOptionVO fromProductSpu(ProductSpuDO spu) {
        AppProductSkuRespOptionVO vo = new AppProductSkuRespOptionVO();
        vo.id = spu.getId();
        vo.name = spu.getName();
        vo.description = spu.getDescription();
        return vo;
    }
}
